namespace Kassandra.Core.Repositories
{
    public class ImageRepository : IImageRepository
    {
        private readonly ICharacterToFileNameTranslator _characterToFileNameTranslator;
        private readonly IPersistFile _persistFile;

        public ImageRepository():this(new CharacterToFileNameTranslator(), new CopyFile())
        {
        }

        public ImageRepository(ICharacterToFileNameTranslator characterToFileNameTranslator, IPersistFile persistFile)
        {
            _characterToFileNameTranslator = characterToFileNameTranslator;
            _persistFile = persistFile;
        }

        public void Save(string fileNameAndPathOfImageToBeSaved, char characterAssociatedWithImageToBeSaved)
        {
            var newImageFileName = _characterToFileNameTranslator.Using(characterAssociatedWithImageToBeSaved);
            _persistFile.From(fileNameAndPathOfImageToBeSaved).To(newImageFileName).Now();
        }
    }
}